<template>
  <text :class="classes" :style="styles"></text>
</template>

<script>
  const prefixCls = 'iconfont icon-'
  import {ObjStyle} from '../common/js/base'

  export default {
    name: 'icon',
    data() {
      return {}
    },
    props: {
      type: String,
      size: [Number, String],
      color: String
    },
    computed: {
      classes() {
        return `${prefixCls}${this.type}`
      },
      styles() {
        let style = {}
        if (this.size) {
          style['font-size'] = `${this.size}px`
        }
        if (this.color) {
          style.color = this.color
        }
        return ObjStyle(style)
      }
    }
  }
</script>

<style scoped>

</style>
